﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage1.master" AutoEventWireup="true" CodeFile="product1.aspx.cs" Inherits="product1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style4
        {
            width: 216px;
        }
        .style6
        {
            width: 97px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div style=" width:70%; margin:20px auto;">

    <asp:FormView ID="FormView1" runat="server" DataKeyNames="shop_sign" 
        DataSourceID="LinqDataSource1" style="margin-right: 9px" Width="478px" 
            onpageindexchanging="FormView1_PageIndexChanging">
        <EditItemTemplate>
            product_name:
            <asp:TextBox ID="product_nameTextBox" runat="server" 
                Text='<%# Bind("product_name") %>' />
            <br />
            manufacturer:
            <asp:TextBox ID="manufacturerTextBox" runat="server" 
                Text='<%# Bind("manufacturer") %>' />
            <br />
            shop_sign:
            <asp:Label ID="shop_signLabel1" runat="server" 
                Text='<%# Eval("shop_sign") %>' />
            <br />
            type:
            <asp:TextBox ID="typeTextBox" runat="server" Text='<%# Bind("type") %>' />
            <br />
            price:
            <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price") %>' />
            <br />
            replace_time:
            <asp:TextBox ID="replace_timeTextBox" runat="server" 
                Text='<%# Bind("replace_time") %>' />
            <br />
            image:
            <asp:TextBox ID="imageTextBox" runat="server" Text='<%# Bind("image") %>' />
            <br />
            inventory:
            <asp:TextBox ID="inventoryTextBox" runat="server" 
                Text='<%# Bind("inventory") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="更新" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="取消" />
        </EditItemTemplate>
        <InsertItemTemplate>
            product_name:
            <asp:TextBox ID="product_nameTextBox" runat="server" 
                Text='<%# Bind("product_name") %>' />
            <br />
            manufacturer:
            <asp:TextBox ID="manufacturerTextBox" runat="server" 
                Text='<%# Bind("manufacturer") %>' />
            <br />
            shop_sign:
            <asp:TextBox ID="shop_signTextBox" runat="server" 
                Text='<%# Bind("shop_sign") %>' />
            <br />
            type:
            <asp:TextBox ID="typeTextBox" runat="server" Text='<%# Bind("type") %>' />
            <br />
            price:
            <asp:TextBox ID="priceTextBox" runat="server" Text='<%# Bind("price") %>' />
            <br />
            replace_time:
            <asp:TextBox ID="replace_timeTextBox" runat="server" 
                Text='<%# Bind("replace_time") %>' />
            <br />
            image:
            <asp:TextBox ID="imageTextBox" runat="server" Text='<%# Bind("image") %>' />
            <br />
            inventory:
            <asp:TextBox ID="inventoryTextBox" runat="server" 
                Text='<%# Bind("inventory") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                CommandName="Insert" Text="插入" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="取消" />
        </InsertItemTemplate>
        <ItemTemplate>
            &nbsp;<asp:Label ID="shop_signLabel" runat="server" Text='<%# Eval("shop_sign") %>' />
            <br />
            &nbsp;<table class="style1" style="height: 297px; width: 100%;">
                <tr>
                    <td class="style4" rowspan="6">
                        <asp:ImageButton ID="ImageButton1" runat="server" Height="296px" 
                            ImageUrl='<%# Eval("image") %>' Width="227px" />
                    </td>
                    <td class="style6">
                        价格</td>
                    <td>
                        <asp:Label ID="priceLabel" runat="server" 
                            style="font-size: x-large; color: #CC3300" Text='<%# Bind("price") %>' />
                    </td>
                </tr>
                <tr>
                    <td class="style6">
                        起批量</td>
                    <td>
                        &gt;=5kg</td>
                </tr>
                <tr>
                    <td class="style6">
                        类型</td>
                    <td>
                        <asp:Label ID="typeLabel" runat="server" Text='<%# Bind("type") %>' />
                    </td>
                </tr>
                <tr>
                    <td class="style6">
                        采购量</td>
                    <td>
                        <asp:TextBox ID="TextBox1" runat="server" Width="50px">5</asp:TextBox>
                        kg</td>
                </tr>
                <tr>
                    <td class="style6">
                        厂家</td>
                    <td>
                        <asp:Label ID="manufacturerLabel" runat="server" 
                            Text='<%# Bind("manufacturer") %>' />
                    </td>
                </tr>
                <tr>
                    <td class="style6">
                        &nbsp;</td>
                    <td>
                        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="加入购物车" />
                    </td>
                </tr>
            </table>
            <br />
            &nbsp;<br />&nbsp;<br />
<br />
            &nbsp;<br />

        </ItemTemplate>
    </asp:FormView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="DataClassesDataContext" EntityTypeName="" TableName="product" 
        Where="shop_sign == @shop_sign">
        <WhereParameters>
            <asp:QueryStringParameter Name="shop_sign" QueryStringField="id" 
                Type="String" />
        </WhereParameters>
    </asp:LinqDataSource>

</div>
</asp:Content>

